package cn.cheqi.recovery.api.vo;

import cn.cheqi.recovery.api.entity.Employee;
import cn.cheqi.recovery.api.entity.Order;
import cn.cheqi.recovery.api.entity.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class OrderVO extends Order {
    private User user;
    private Employee employee;

    /**
     * 订单查询的起始时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startDate;

    /**
     * 订单查询的结束时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    private Integer page = 1;
    private Integer limit = 10;

    @Override
    public String toString() {
        return super.toString()+" OrderVO{" +
                "user=" + user +
                ", employee=" + employee +
                ", startDate=" + startDate +
                ", endDate=" + endDate +
                ", page=" + page +
                ", limit=" + limit +
                '}';
    }
}
